package cn.webrx;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class List5 {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>(List.of(1, 1, 1, 55, 2, 3, 3, 3, 3, 5));
        System.out.println(list);
        //
        System.out.println(list.get(list.indexOf(55)));

        System.out.println(list.get(0));

        System.out.println("--------------");
        for (Integer i : list) {
            System.out.printf("%d ", i);
        }
        System.out.println();
        for (int i = list.size() - 1; i >= 0; i--) {
            System.out.printf("%d ", list.get(i));
        }
        System.out.println();
        Collections.reverse(list);//Collections 是工具类，reverse() 方法将集合颠倒
        System.out.println(list);

        Collections.shuffle(list);
        System.out.println(list);
    }
}
